import request from '@/utils/request'

/**
 * 搜索接口，已自动筛选失效管理员
 * @param filter 搜索筛选器
 * @param index 页码
 * @param size 页面大小
 * @returns {AxiosPromise}
 */
export function search(filter, index, size) {
  filter.valid = 1
  return request({
    url: '/fridge/search',
    method: 'post',
    data: {
      filter,
      index,
      size
    }
  })
}

/**
 * 标记生效接口
 * @param filter 标记筛选器
 * @returns {AxiosPromise}
 */
export function valid(filter) {
  return request({
    url: '/fridge/valid',
    method: 'post',
    data: {
      filter
    }
  })
}

export function deleted(filter) {
  return request({
    url: '/fridge/delete',
    method: 'post',
    data: {
      filter
    }
  })
}

